<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>添加小朋友信息</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='add_child.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}">
</head>

<body>
    <!-- 显示用户登录信息和退出按钮 -->
    {% if current_user.is_authenticated %}
    <div class="user-info">
        <span class="welcome-text">欢迎，{{ current_user.username }}</span>
        <a href="{{ url_for('logout') }}" class="logout-button">退出登录</a>
    </div>
    {% endif %}

    <div class="main-container">
        <h1>添加小朋友信息</h1>
        <form method="post" class="child-form">
            {{ form.hidden_tag() }}
            <div class="form-group">
                <label >{{ form.name.label.text }}</label>
                {{ form.name(placeholder="请输入小朋友姓名", class="form-control") }}
                {% if form.name.errors %}
                <span class="error">{{ form.name.errors[0] }}</span>
                {% endif %}
            </div>
            <div class="form-group">
                <label >{{ form.birth_date.label.text }}</label>
                {{ form.birth_date(placeholder="请输入小朋友出生日期", class="form-control") }}
                {% if form.birth_date.errors %}
                <span class="error">{{ form.birth_date.errors[0] }}</span>
                {% endif %}
            </div>
            <div class="form-group">
                <label>{{ form.gender.label.text }}</label>
                {{ form.gender(class="form-control") }}
                {% if form.gender.errors %}
                <span class="error">{{ form.gender.errors[0] }}</span>
                {% endif %}
            </div>
            <div class="form-group">
                <label >{{ form.height.label.text }}</label>
                {{ form.height(placeholder="请输入小朋友身高", class="form-control") }}
                {% if form.height.errors %}
                <span class="error">{{ form.height.errors[0] }}</span>
                {% endif %}
            </div>
            <div class="form-group">
                <label>{{ form.weight.label.text }}</label>
                {{ form.weight(placeholder="请输入小朋友体重", class="form-control") }}
                {% if form.weight.errors %}
                <span class="error">{{ form.weight.errors[0] }}</span>
                {% endif %}
            </div>
            <div class="form-group submit-group">
                {{ form.submit(class="btn btn-primary") }}
            </div>
        </form>
        <a href="{{ url_for('user_main') }}" class="back-button">返回主页面</a>
    </div>
</body>

</html>
